import React from 'react';
import { Terminal, BrainCircuit, Database, Globe, Sparkles, Code, Github } from 'lucide-react';
import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Link } from 'react-router-dom';

const Index = () => {
  const tools = [
    {
      title: "SQL生成器",
      description: "使用自然语言生成SQL查询语句",
      icon: <Database className="text-blue-500" size={24} />,
      path: "/sql-generator",
      color: "bg-blue-100 hover:bg-blue-200"
    },
    {
      title: "Python爬虫生成器",
      description: "快速创建网页数据抓取脚本",
      icon: <Globe className="text-green-500" size={24} />,
      path: "/python-crawler",
      color: "bg-green-100 hover:bg-green-200"
    },
    {
      title: "Prompt生成器",
      description: "创建专业AI指令模板",
      icon: <Sparkles className="text-purple-500" size={24} />,
      path: "/prompt-generator",
      color: "bg-purple-100 hover:bg-purple-200"
    },
    {
      title: "代码转换器",
      description: "在不同编程语言间转换代码",
      icon: <Code className="text-orange-500" size={24} />,
      path: "/code-converter",
      color: "bg-orange-100 hover:bg-orange-200"
    },
    {
      title: "GitHub代理",
      description: "加速访问GitHub资源",
      icon: <Github className="text-gray-800" size={24} />,
      path: "/github-proxy",
      color: "bg-gray-100 hover:bg-gray-200"
    },
    {
      title: "Linux命令生成器",
      description: "生成Linux系统命令",
      icon: <Terminal className="text-yellow-500" size={24} />,
      path: "/linux-command",
      color: "bg-yellow-100 hover:bg-yellow-200"
    }
  ];

  return (
    <div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-50 p-4 md:p-8">
      <div className="max-w-4xl mx-auto">
        <div className="text-center mb-10">
          <div className="flex justify-center mb-4">
            <BrainCircuit className="text-indigo-600" size={48} />
          </div>
          <h1 className="text-3xl md:text-4xl font-bold text-gray-800 mb-2">
            AI 助手工具
          </h1>
          <p className="text-gray-600 max-w-2xl mx-auto">
            使用人工智能快速生成 SQL 查询、Python 爬虫、代码转换、专业Prompt、GitHub代理服务和Linux命令，提升开发效率
          </p>
        </div>

        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-10">
          {tools.map((tool, index) => (
            <Card key={index} className={`${tool.color} transition-colors duration-300`}>
              <CardHeader className="pb-3">
                <div className="flex items-center gap-3">
                  {tool.icon}
                  <CardTitle>{tool.title}</CardTitle>
                </div>
              </CardHeader>
              <CardContent>
                <p className="text-gray-700">{tool.description}</p>
              </CardContent>
              <CardFooter>
                <Button asChild className="w-full">
                  <Link to={tool.path}>开始使用</Link>
                </Button>
              </CardFooter>
            </Card>
          ))}
        </div>

        <div className="bg-white rounded-xl shadow-lg p-6 border border-gray-200">
          <div className="flex items-center gap-3 mb-4">
            <Terminal className="text-yellow-500" size={24} />
            <h2 className="text-xl font-semibold">工具特点</h2>
          </div>
          <div className="grid grid-cols-1 md:grid-cols-4 gap-4 text-gray-700">
            <div>
              <h3 className="font-medium mb-2">智能生成</h3>
              <ul className="list-disc pl-5 space-y-1">
                <li>基于AI的自然语言理解</li>
                <li>自动生成可运行代码</li>
                <li>支持多种编程语言和框架</li>
              </ul>
            </div>
            <div>
              <h3 className="font-medium mb-2">高效开发</h3>
              <ul className="list-disc pl-5 space-y-1">
                <li>减少重复编码工作</li>
                <li>快速原型开发</li>
                <li>一键复制生成代码</li>
              </ul>
            </div>
            <div>
              <h3 className="font-medium mb-2">专业工具</h3>
              <ul className="list-disc pl-5 space-y-1">
                <li>结构化指令模板</li>
                <li>GitHub资源加速</li>
                <li>支持多场景应用</li>
              </ul>
            </div>
            <div>
              <h3 className="font-medium mb-2">系统命令</h3>
              <ul className="list-disc pl-5 space-y-1">
                <li>Linux命令自动生成</li>
                <li>支持主流发行版</li>
                <li>终端命令优化</li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
};

export default Index;
